package org.jsola.hr.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import org.jsola.core.dto.BaseDTO;
import org.jsola.core.validator.Const;
import org.jsola.hr.constant.RemindUnitEnum;
import org.jsola.hr.entity.MemoEmpDO;

import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

import static org.jsola.core.example.BaseExample.*;
import static org.jsola.hr.example.MemoConfigExample.*;
import static org.jsola.hr.example.MemoInfoExample.*;
import static org.jsola.core.example.BaseExample.E_ID;
import static org.jsola.core.example.BaseExample.M_ID_NOT_NULL;
import static org.jsola.core.example.BaseExample.N_ID;
import static org.jsola.hr.example.MemoInfoExample.E_COMPANY_ID;
import static org.jsola.hr.example.MemoInfoExample.E_COMPLETED;
import static org.jsola.hr.example.MemoInfoExample.E_CONFIG_ID;
import static org.jsola.hr.example.MemoInfoExample.E_CONTENT;
import static org.jsola.hr.example.MemoInfoExample.E_REMIND_BEFORE;
import static org.jsola.hr.example.MemoInfoExample.E_REMIND_DATE;
import static org.jsola.hr.example.MemoInfoExample.E_REMIND_NEED;
import static org.jsola.hr.example.MemoInfoExample.E_REMIND_TIME;
import static org.jsola.hr.example.MemoInfoExample.E_REMIND_TIME_BY_DATE;
import static org.jsola.hr.example.MemoInfoExample.E_REMIND_TIME_BY_TIME;
import static org.jsola.hr.example.MemoInfoExample.E_REMIND_TYPE;
import static org.jsola.hr.example.MemoInfoExample.E_TITLE;
import static org.jsola.hr.example.MemoInfoExample.M_COMPANY_ID_MAX;
import static org.jsola.hr.example.MemoInfoExample.M_COMPANY_ID_NOT_NULL;
import static org.jsola.hr.example.MemoInfoExample.M_CONFIG_ID_MAX;
import static org.jsola.hr.example.MemoInfoExample.M_CONTENT_MAX;
import static org.jsola.hr.example.MemoInfoExample.M_REMIND_TIME_BY_DATE_MAX;
import static org.jsola.hr.example.MemoInfoExample.M_REMIND_TIME_BY_TIME_MAX;
import static org.jsola.hr.example.MemoInfoExample.M_REMIND_TIME_MAX;
import static org.jsola.hr.example.MemoInfoExample.M_TITLE_MAX;
import static org.jsola.hr.example.MemoInfoExample.N_COMPANY_ID;
import static org.jsola.hr.example.MemoInfoExample.N_COMPLETED;
import static org.jsola.hr.example.MemoInfoExample.N_CONFIG_ID;
import static org.jsola.hr.example.MemoInfoExample.N_CONTENT;
import static org.jsola.hr.example.MemoInfoExample.N_REMIND_BEFORE;
import static org.jsola.hr.example.MemoInfoExample.N_REMIND_DATE;
import static org.jsola.hr.example.MemoInfoExample.N_REMIND_NEED;
import static org.jsola.hr.example.MemoInfoExample.N_REMIND_TIME;
import static org.jsola.hr.example.MemoInfoExample.N_REMIND_TIME_BY_DATE;
import static org.jsola.hr.example.MemoInfoExample.N_REMIND_TIME_BY_TIME;
import static org.jsola.hr.example.MemoInfoExample.N_REMIND_TYPE;
import static org.jsola.hr.example.MemoInfoExample.N_TITLE;

/**
 * 备忘录
 *
 * @author zhr
 */
@EqualsAndHashCode(callSuper = true)
@ApiModel(description = "修改【备忘录】的参数")
@Data
public class MemoInfoUpdateDTO extends BaseDTO {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(notes = N_ID, example = E_ID, required = true)
    @NotNull(message = M_ID_NOT_NULL)
    private String id;

    @ApiModelProperty(notes = N_TITLE, example = E_TITLE)
    @Length(max = 255, message = M_TITLE_MAX)
    private String title;

    @ApiModelProperty(notes = N_CONTENT, example = E_CONTENT)
    @Length(max = 2000, message = M_CONTENT_MAX)
    private String content;

    @ApiModelProperty(notes = N_REMIND_DATE, example = E_REMIND_DATE)
    private Date remindDate;

    @ApiModelProperty(notes = N_REMIND_TIME, example = E_REMIND_TIME)
    private String remindTime;

    @ApiModelProperty(notes = N_REMIND_NEED, example = E_REMIND_NEED)
    private Boolean remindNeed;

    @ApiModelProperty(notes = N_REMIND_BEFORE, example = E_REMIND_BEFORE)
    private Integer remindBefore;

    @ApiModelProperty(notes = N_COMPLETED, example = E_COMPLETED)
    private Boolean completed;

    @ApiModelProperty(notes = N_COMPANY_ID, example = E_COMPANY_ID, required = true)
    @NotNull(message = M_COMPANY_ID_NOT_NULL)
    @Length(max = 32, message = M_COMPANY_ID_MAX)
    private String companyId;

    @ApiModelProperty(notes = N_REMIND_TYPE, example = E_REMIND_TYPE)
//    @NotNull(message = "提醒日期类型不能为空 1固定日期提醒，2周期性提醒")
    private Integer remindType;

    @ApiModelProperty(notes = N_REMIND_TIME_BY_DATE, example = E_REMIND_TIME_BY_DATE)
    @Length(max = 50, message = M_REMIND_TIME_BY_DATE_MAX)
    private String remindTimeByDate;

    @ApiModelProperty(notes = N_REMIND_TIME_BY_TIME, example = E_REMIND_TIME_BY_TIME)
    @Length(max = 50, message = M_REMIND_TIME_BY_TIME_MAX)
    private String remindTimeByTime;

    @ApiModelProperty(notes = N_MEMO_EMP_DO_LIST, example = E_MEMO_EMP_DO_LIST)
    private List<MemoEmpDO> memoEmpDOList;

    @ApiModelProperty(notes = N_CONFIG_ID, example = E_CONFIG_ID)
    @Length(max = 50, message = M_CONFIG_ID_MAX)
    private String configId;

    @ApiModelProperty(notes = N_REMIND_UNIT, example = E_REMIND_UNIT, allowableValues = RemindUnitEnum.VALUES_STR)
    @Length(max = 20, message = M_REMIND_UNIT_MAX)
    @Const(constClass = RemindUnitEnum.class, message = M_REMIND_UNIT_ENUM_NOT_MATCH)
    private String remindUnit;

    @ApiModelProperty(notes = N_REMIND_MONTH_UNIT_VALUE, example = E_REMIND_MONTH_UNIT_VALUE)
    @Length(max = 20, message = M_REMIND_MONTH_UNIT_VALUE_MAX)
    private String remindMonthUnitValue;


}

